Report Section
The TPT report node section
adds a section or subsection to the report. Often it is very useful to set an ID for the section to be able to refer to this section later on in the script.
It might necessary to add a result to a section created with TPTReport.add(section)
.
You can use section.setResult()
or section.addResult()
, where section
is the name of your section.
section.setResult(TPT.FAILED)
section.setResult(TPT.PASSED)
section.setResult(TPT.INCONCLUSIVE)
section.addReport(TPT.PASSED)
section.addReport(TPT.FAILED)
section.addReport(TPT.INCONCLUSIVE)
The difference between setReport()
and addReport()
is that addReport()
finds the worst result set by you, and setReport()
displays the last set result for the section. For example:
#report will display section1 as PASSED
section1.setReport(FAILED)
section1.setReport(PASSED)
#report will display section2 as FAILED
section2.addReport(FAILED)
section2.addReport(PASSED)
|
The following example shows another way how to add subsections: section = TPTReport.Section("Section")
|